public class ThreadDemo {
    public static void main(String[] args) throws InterruptedException {
        Mythread thread1 = new Mythread();
        thread1.start();
        thread1.sleep(5000);
        thread1.stop();
    }
}
class Mythread extends Thread{
        @Override
    public void run() {
                System.out.println("thread is running");
    }
}
